<?php

include_once 'Classes/PHPCodeProvider.php';

/*
 * Create an instance of the CodeGeneratorOptions class
 * using the default options for code generation.
 */

$options = new CodeGeneratorOptions();

/*
 * Create an instance of the IndentedTextWriter.
 */

$writer = new IndentedTextWriter();

/*
 * ThisReferenceExpression example usage within a MethodReferenceExpression
 */

$thisReference = new ThisReferenceExpression();
$methodRef2 = new MethodReferenceExpression('incrementWins', $thisReference);


/*
 * Generate the code
 */

$provider = new PHPCodeProvider();

$provider->generateCodeFromExpression($methodRef2, $writer, $options);

echo 
    '<pre>' . str_replace(
        '<br />', '', highlight_string($writer->get_String(), true)) . 
    '<pre/>';

/*
 * The output should be :
 * 
 * $this->incrementWins
 * 
 */
?>
